'use strict';

/** @type {import('sequelize-cli').Migration} */
module.exports = {
  async up (queryInterface, Sequelize) {
    /**
     * Add seed commands here.
     *
     * Example:
     * await queryInterface.bulkInsert('People', [{
     *   name: 'John Doe',
     *   isBetaMember: false
     * }], {});
    */
    await queryInterface.bulkInsert('Comments', [
      {
        content: '我是第一个一级评论',
        userId: 1,
        postId: 1,
        parentId: null,
        rootId: null,
        level: 1,
        createdAt: new Date(),
        updatedAt: new Date()
      },
      {
        content: '我是二级评论',
        userId: 2,
        postId: 1,
        parentId: 1,
        rootId: 1,
        level: 2,
        createdAt: new Date(),
        updatedAt: new Date()
      },
      {
        content: '我是二级评论的二级评论',
        userId: 1,
        postId: 1,
        parentId: 2,
        rootId: 1,
        level: 3,
        createdAt: new Date(),
        updatedAt: new Date()
      },
      {
        content: '我是第二个一级评论',
            userId: 2,
          postId: 1,
          parentId: null,
          rootId: null,
          level: 1,
          createdAt: new Date(),
          updatedAt: new Date()
      },
    ])
  },

  async down (queryInterface, Sequelize) {
    /**
     * Add commands to revert seed here.
     *
     * Example:
     * await queryInterface.bulkDelete('People', null, {});
     */
    await queryInterface.bulkDelete('Comments', null, {})
  }
};
